package vivace.model;

public class TimeSignature extends MusicalObject {
	
	/** Numerator of the time signature */
	private int numerator;
	
	/** Denominator of the time signature */
	private int denominator;
	
    // TODO: Maybe include the metamessage here as well?


	/** 
	 * Constructor for TimeSignature
	 * @param num Numerator
	 * @param den Denominator
     * @param res resolution
	 */
	public TimeSignature(int num, int den, long res) {
		numerator = num;
		denominator = den;
        resolution = res;
        length = resolution * num;
	}


    public String toString(){
        return null;
    }

    /**
     * Constructs a TimeSignature from a meta message in the form of a char array
     * @param metaMessage the message containing a change of beat.
     * @param resolution the resolution of the project;
     */
    public TimeSignature(byte[] mm, long resolution){
        this(mm[3],1<<mm[4], resolution);
    }

	/** 
	 * No-arg constructor. Returns a 4/4 time signature
	 */
	public TimeSignature(long resolution) {
		this(4,4, resolution);
	}
	
	/**
	 * Returns the numerator of the time signature
	 * @return
	 */
	public int getNumerator() {
		return numerator;
	}
	
	/**
	 * Returns the denominator of the time signature
	 * @return
	 */
	public int getDenominator() {
		return denominator;
	}

	/**
	 * Sets the numerator of the time signature
	 * @param numerator
	 */
	public void setNumerator(int numerator) {
		this.numerator = numerator;
	}

	/**
	 * Sets the denominator of the time signature
	 * @param denominator
	 */
	public void setDenominator(int denominator) {
		this.denominator = denominator;
	}
}
